The CIFTP Control Reference
 The Crescent Internet ToolPak FTP Control Reference
Related Topics

Control File

CIFTP.OCX
CIFTP16.OCX

Object Type

CIFTP

Purpose

The Crescent Internet ToolPak File Transfer Protocol (CIFTP) control enables you to build customized FTP applications that perform tasks such as the following:

Copying files from an FTP server.

Copying files to an FTP server.

Monitoring files on an FTP site and notifying specified users when an update occurs.

The CIFTP control complies with the FTP standards defined in RFC 959.

Comments

If you are creating a control array of CIFTP controls at run time, you must set each control's Visible property to True, before you attempt to establish a connection. Otherwise, the CIFTP control fires a WSAError event that returns an error_number of 22. The following example creates a second CIFTP control and sets its Visible property to True.

Load CIFTP(1)
CIFTP(1).Visible = True

Properties

About	AccessPort c	Container
DataPort c	DirectoryListBoxName c	Drag
DragIcon	DragMode	EventState c
FileAttributeMask c	FileListBoxName c	FileNameMask c
Files  c	Height	HostAddress c
HostName c	Index	Left
LocalFileName c	LoginName c	MethodState c
Move	Name	Object
OverwriteExistingFile c	Parent	Password c
RemoteFileName c	RepresentationType c	ShowWhatsThis
Top	Visible	WhatThisHelpID
Width	WorkingDirectory c
Events

AccessControlChannelClosed c	AccessControlChannelConnection c	AccessControlPacketReceived c
AccessControlPacketSent c	DataControlChannelClosed c	DataControlChannelConnection c
DataControlPacketReceived c	DataControlPacketSent c	DataPortSet c
DragDrop	DragOver	EventStateChanged c
FileClosed c	FTPStatus c	GotDirectory c
GotFile c	InternetError c	ListBoxesPopulated c
MethodStateChanged c	PutFile c	ServerResponse c
SocketClosed c	TotalFileBytesReceived c	WSAError c
Methods

APPE c,d	CDUP a,c	CleanupConnection a,c
CleanupDataConnection c,d	ConnectToAccessControlChannel c	ConnectToDataChannel c
CWD a,c	GetDirectory c	GetFile c
LIST c,d	PASS a,c	PASV a,c
PORT c PutFile c	PWD a,c	QUIT a,c
RETR c,d	SendFTPCommand a,c,d	STOR c,d
SYST a,c	TYPE a,c	USER a,c
ZOrder
Objects

Files Collection c	File Object c
a  Low-level method that requires an access control channel
c  A custom or modified property, method, or event
d  Low-level method that requires a data access channel


AccessPort Property

Applies To

CIFTP

Purpose

The AccessPort property sets the port number used for access control requests and replies.

Syntax

[Form.]CIFTP.AccessPort[ = Integer]

Data Type

Integer

Usage

Read/Write at design time and run time.

Comments

The AccessPort is the port on which the AccessControlChannel operates. The AccessControlChannel relays commands and responses between the client and server. Set this property before attempting to connect to an FTP server. The default value is 21. Usually, you do not need to change the value for the access port.

See Also

AccessControlChannelConnection, ConnectToAccessControlChannel, DataPort


DataPort Property

Applies To

CIFTP

Purpose

The DataPort property returns the port number used for the receipt of data.

Syntax

[Form.]CIFTP.DataPort[ = Integer]

Data Type

Integer

Usage

Read/Write at run time. Unavailable at design time.

Comments

The FTP server notifies the client which port to establish as the port on which to send the data. This property is updated by CIFTP once a response to the PASV method is received. If you use the PORT method instead of PASV, you must set the DataPort property before calling the method.

When it is set, CIFTP fires the DataPortSet event. Once the DataPortSet event fires, you can call the ConnectToDataChannel method to establish a data connection. You can start any FTP task after the DataChannelConnection event fires.

Usually, the DataPort property is set indirectly by calling the PASV method. This causes the FTP server to return a string containing the data port in the format a.b.c.d.p1.p2 where a.b.c.d is an IP address and p1.p2 determine the port. The CIFTP control calculates the port number using the following algorithm; (p1 * 256) + p2 and places this value in the DataPort property and then fires the DataPortSet event.

NOTE  	If your FTP server does not support PASV, you must set this property directly before using any method that requires a data connection.

See Also

AccessControlChannelConnection, AccessPort, ConnectToAccessControlChannel, ConnectToDataChannel, DataPortSet, PASV


DirectoryListBoxName Property

Applies To

CIFTP

Purpose

The DirectoryListBoxName property sets the name of a ListBox control that is bound to the CIFTP control. When the control retrieves a directory listing from the FTP server, it populates the ListBox with the data.

Syntax

Set [Form.]CIFTP.DirectoryListBoxName [ = ObjectName]

Data Type

Object

Usage

Read/Write at run time only.

Comments

Set DirectoryListBoxName, FileListBoxName and WorkingDirectory before invoking the LIST or the PWD methods. After the DirectoryListBox and the FileListBox objects are populated, the ListBoxesPopulated event fires.

See Also

FileListBoxName, LIST, PWD, WorkingDirectory


EventState Property

Applies To

CIFTP

Purpose

The EventState property returns the event currently in progress.

Syntax

[Integer] = [Form.]CIFTP.EventState

Data Type

Integer

Usage

Read-only at run time. Unavailable at design time.

Comments

CIFTP updates EventState when any of the CIFTP events (except the PacketReceived events) fire. When the EventState property changes, CIFTP fires the EventStateChanged event.

The valid EventState property values are listed in the following table and are also in the CITPAK.BAS file.

This event...	has this constant...	with this integer value...
FileClosed	CIFTP_FCLOSED	100
SocketClosed	CIFTP_SCLOSED	101
AccessControlChannelClosed	CIFTP_ACCLOSED	102
DataControlChannelClosed	CIFTP_DCCLOSED	103
AccessControlChannelConnection	CIFTP_ACCONN	104
DataControlChannelConnection	CIFTP_DCCONN	105
DataPortSet	CIFTP_DPORTSET	106
ListBoxesPopulated	CIFTP_LBPOP	107
You can test EventState to initiate an action or control program flow.

See Also

EventStateChanged


FileAttributeMask Property

Applies To

CIFTP

Purpose

The FileAttributeMask property lets you select which files are returned based on their attributes by specifying one or more symbolic constants from the CIFTP control library.

Syntax

[Form.]CIFTP.FileAttributeMask[ = Long]

Data Type

Long

Usage

Read/Write at design time and run time.

Comments

Only files whose attributes match the flags set in the FileAttributeMask property are returned. The default value is FILE_ATTRIBUTE_NORMAL Or FILE_ATTRIBUTE_DIRECTORY (144), where the Or is a Visual Basic bit-wise Or operator.

NOTE  	When you set the FILE_ATTRIBUTE_NORMAL attribute flag, all types of files are returned. At this time, you cannot request a specific type of file, such as a system or read-only file, because this level of specificity is not currently supported by remote FTP servers.

The following table lists the symbolic constants for the attribute flags and their values, which you can specify in any combination in the FileAttributeMask property. At this time, only the FILE_ATTRIBUTE_NORMAL and the FILE_ATTRIBUTE_DIRECTORY attribute flags are supported by remote FTP servers. The rest of the attribute flags are not currently supported by FTP servers, but they are available for your use when they become supported.

Symbolic Constant for Attribute Flags	Hexadecimal Value
FILE_ATTRIBUTE_READONLY	&h0001
FILE_ATTRIBUTE_HIDDEN	&h0002
FILE_ATTRIBUTE_SYSTEM	&h0004
FILE_ATTRIBUTE_DIRECTORY	&h0010
FILE_ATTRIBUTE_ARCHIVE	&h0020
FILE_ATTRIBUTE_NORMAL	&h0080
FILE_ATTRIBUTE_TEMPORARY	&h0100
FILE_ATTRIBUTE_COMPRESSED	&h0800
FILE_ATTRIBUTE_OFFLINE	&h1000
See Also

FileNameMask


FileListBoxName Property

Applies To

CIFTP

Purpose

The FileListBoxName property sets the name of the ListBox control that is bound to the CIFTP control. When the control retrieves a file list from the FTP server, it populates the ListBox with the data.

Syntax

Set [Form.]CIFTP.FileListBoxName [ = ObjectName]

Data Type

Object

Usage

Read/Write at run time only.

Comments

Set DirectoryListBoxName, FileListBoxName and WorkingDirectory before invoking the LIST or the PWD methods.

The LIST or PWD method populates the FileListBox object. After the FileListBox and the DirectoryListBox objects are populated the ListBoxesPopulated event fires.

See Also

DirectoryListBoxName, LIST, PWD, WorkingDirectory


FileNameMask Property

Applies To

CIFTP

Purpose

The FileNameMask property lets you use standard wildcard masks to select which files are returned.

Syntax

Set [Form.]CIFTP.FileNameMask[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

Only files whose names match the pattern specified by the FileNameMask property are returned. The default mask value is *.*.

The following table lists the wildcard characters you can use in the wildcard mask.

A character in the mask pattern...	Matches these characters...
? (Question mark)	Any single character
* (Asterisk)	Zero or more characters
See Also

FileAttributeMask


Files Property

Applies To

CIFTP

Purpose

The Files property contains the current collection of File objects.

Syntax

[Form.]CIFTP.Files

Data Type

Files collection

Usage

Read-only at run time. Unavailable at design time.

Comments

The Files collection represents the files available on an FTP server. The Files collection behaves like other standard Visual Basic collections. See the File object for a list of its properties.

See Also

Files collection, File object


HostAddress Property

Applies To

CIFTP

Purpose

The HostAddress property sets or returns the IP address of the FTP server.

Syntax

[Form.]CIFTP.HostAddress[ = String]

Data Type

String

Usage

Read/Write at design time.

Comments

The HostAddress identifies the host to the network (the Internet). HostAddress consists of the network number and the local host number. You must use either the HostName or HostAddress to send or retrieve data from an FTP server.

An example of an IP address is;

198.137.64.1

NOTE  	You must use either the HostName or HostAddress property to connect to an FTP server. When you provide both, CIFTP uses HostName.

Setting the HostAddress property causes any connection established by a high-level method (GetDirectory, GetFile, and PutFile) to disconnect.

See Also

GetDirectory, GetFile, HostName, PutFile


HostName Property

Applies To

CIFTP

Purpose

The HostName property sets or returns the DNS name of the FTP server.

Syntax

[Form.]CIFTP.HostName[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

The HostName is the name that identifies an FTP server to the Internet. Depending on your connection to the Internet, the HostName might contain simply a machine name like crescentserver, or it can be a fully qualified Internet name that follows a DNS format such as ; machine.organizationname.com. Note, your domain name might be different, depending on the type of your organization. The following table list other domains;

This domain . . .	Identifies this type of organization . . .
.com	Identifies commercial organizations.
.org	Identifies non-profit organizations.
.gov	Identifies U.S. government organizations.
.edu	Identifies educational institutions.
Contact your site administrator to determine the correct format to supply.

Set HostAddress or HostName before calling the ConnectToFTPServer method.

NOTE  	You must use either the HostName or the HostAddress property to connect to an FTP server. When you provide both, CIFTP uses HostName.

Setting the HostName property causes any connection established by a high-level method (GetDirectory, GetFile, and PutFile) to disconnect.

See Also

GetDirectory, GetFile, HostAddress, PutFile


LocalFileName Property

Applies To

CIFTP

Purpose

The LocalFileName property when used with the RETR method, sets the path and name of the local file on the client into which data is copied from the FTP server. When used with the STOR or APPE method, the LocalFileName property sets the path and name of the local file to be copied to the FTP server.

Syntax

[Form.]CIFTP.LocalFileName[ = String]
If FileLen(filename) > 0 Then ' error if no file or bad filename
'file exists and is greater than 0 bytes, add code to send file
End If

Data Type

String

Usage

Read/Write at design time and run time.

Comments

When you use the RETR method to copy data from the FTP server, the CIFTP control updates the local file specified by the LocalFileName property. If a local file exists with the same name, the RETR method overwrites the file.

When you use the STOR or APPE method to copy data to the FTP server, the CIFTP control copies the data from the source file specified by the LocalFileName property to the FTP server.

NOTE  	If you specified a file name in the LocalFileName property when you call the LIST method, the directory listing is written to this file.

See Also

APPE, RemoteFileName, RETR, STOR, LIST


LoginName Property

Applies To

CIFTP

Purpose

The LoginName property sets the login name used to connect to an FTP server.

Syntax

[Form.]CIFTP.LoginName[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

The USER method passes the LoginName to the FTP server.

NOTE  	Your application's users must have an account on the FTP server with the appropriate access level to the files that the application accesses. In addition, some FTP servers support a user name of anonymous. Anyone can login as anonymous, but they will have limited privileges.

See Also

PASS, Password, USER


MethodState Property

Applies To

CIFTP

Purpose

The MethodState property returns the method currently in progress.

Syntax

[Integer] = [Form.]CIFTP.MethodState

Data Type

Integer

Usage

Read/Write at run time. Unavailable at design time.

Comments

CIFTP updates MethodState when you call a method like PASS, PASV, or PWD. When the MethodState property changes, CIFTP fires the MethodStateChanged event.

The valid MethodState property values are listed in the following table and are also in the CITPAK.BAS file.

This method...	has this constant...	with this integer value...
PASS	CIFTP_PASS	1
USER	CIFTP_USER	2
SYST	CIFTP_SYST	3
TYPE	CIFTP_TYPE	4
LIST	CIFTP_LIST	5
QUIT	CIFTP_QUIT	6
PASV	CIFTP_PASV	7
RETR	CIFTP_RETR	8
STOR	CIFTP_STOR	9
CWD	CIFTP_CWD	10
PWD	CIFTP_PWD	11
NLST	CIFTP_NLST	12
CDUP	CIFTP_CDUP	13
APPE	CIFTP_APPE	14
You can test the MethodState to initiate an action or control program flow.

See Also

MethodStateChanged


OverwriteExistingFile Property

Applies To

CIFTP

Purpose

The OverwriteExistingFile property lets you specify whether an existing file will be overwritten by the high-level method GetFile.

Syntax

[Form.]CIFTP.OverwriteExistingFile[ = Boolean]

Data Type

Boolean

Usage

Read/Write at design time and run time.

Comments

When the OverwriteExistingFile property is set to True, an existing file can be overwritten by the high-level method GetFile. The default value is False, which prevents existing files from being overwritten.

NOTE  	The OverwriteExistingFile property does not affect the low-level method RETR. This means that the RETR method will overwrite an existing file even though the OverwriteExistingFile property is set to False.

See Also

GetFile


Password Property

Applies To

CIFTP

Purpose

The Password property sets or returns the password.

Syntax

[Form.]CIFTP.Password[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

The PASS method passes the Password to the FTP server. The password must be valid for the login name passed by USER.

See Also

LoginName, PASS, USER


RemoteFileName Property

Applies To

CIFTP

Purpose

The RemoteFileName property when used with the RETR method, sets the path and name of the remote file on the FTP server that you want to copy. When the RemoteFileName property is used with the STOR or APPE method, it sets the path and name of the remote file that you want to copy to or append to on the FTP server.

Syntax

[Form.]CIFTP.RemoteFileName[ = String]
If FileLen(filename) > 0 Then ' error if no file or bad filename
'file exists and is greater than 0 bytes, add code to send file
End If

Data Type

String

Usage

Read/Write at design time and run time.

Comments

When you use the RETR method to copy data from the FTP server, the CIFTP control copies the file from the FTP server that is specified by the RemoteFileName property into a local file specified by the LocalFileName property. If a local file exists with the same name, the RETR method overwrites the file.

When you use the STOR or APPE method to copy data to the FTP server, the CIFTP control updates the remote file specified by the RemoteFileName property. If a remote file exists with the same name, the STOR method overwrites the file.

See Also

APPE, LocalFileName, RETR, STOR


RepresentationType Property

Applies To

CIFTP

Purpose

The RepresentationType property sets the data format that you want the FTP server to use when it transmits the data to the client.

Syntax

[Form.]CIFTP.RepresentationType[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

The TYPE method passes the RepresentationType to the FTP server.

Use this value...	to retrieve this kind of data...
A	ASCII
I	Binary
E	EBCDIC
NOTE  	When using low-level methods, you must call the TYPE method to request that the FTP server use the specified format.

See Also

TYPE


WorkingDirectory Property

Applies To

CIFTP

Purpose

The WorkingDirectory property sets or returns the path and name of the current working directory on the FTP server.

Syntax

[Form.]CIFTP.WorkingDirectory[ = String]

Data Type

String

Usage

Read/Write at design time and run time.

Comments

If you know the directory on the FTP server that you want to access, set the WorkingDirectory property before calling the CWD method. If you do not set a WorkingDirectory, CIFTP logs you in to the default directory for the login. You can then use CWD or CDUP to traverse the server's file system.

The PWD method updates the WorkingDirectory property to the current directory on the FTP server.

See Also

CWD, FileListBoxName, GetDirectory, LIST


AccessControlChannelClosed Event

Applies To

CIFTP

Purpose

The AccessControlChannelClosed event fires when the connection to the FTP server terminates.

Syntax

Sub CIFTP_AccessControlChannelClosed()

Comments

You terminate a connection to an FTP server with the QUIT method.

Many FTP servers disconnect an access control channel after a specific period of time (such as 10 minutes) elapses, when there is no activity on the access control channel. Therefore, you might want to write additional code to handle this possibility.

See Also

ConnectToAccessControlChannel, QUIT


AccessControlChannelConnection Event

Applies To

CIFTP

Purpose

The AccessControlChannelConnection event fires when a connection to an FTP server is established. The connection is to an access control channel that passes requests and replies (but no data) between client and server.

Syntax

Sub CIFTP_AccessControlChannelConnection()

Comments

Use the ConnectToAccessControlChannel method to request a connection to an FTP server. Once the AccessControlChannelConnection event fires, your application can start to interact with the FTP server. You cannot however start to retrieve data from an FTP server until you also establish a data channel connection with the ConnectToDataControlChannel method.

See Also

AccessPort, ConnectToAccessControlChannel, ConnectToDataChannel, PASV


AccessControlPacketReceived Event

Applies To

CIFTP

Purpose

The AccessControlPacketReceived event fires when CIFTP receives a packet, over the access control channel, from the FTP server.

Syntax

Sub CIFTP_AccessControlPacketReceived(ByVal Packet As String)

Comments

The Packet contains information from the server about whether an access control request was granted or denied. The server responds on the access control channel to every CIFTP method that you call.

After the AccessControlPacketReceived event fires, one or more ServerResponse events fire for each of the server response codes contained in the packet.

See Also

AccessControlPacketSent, DataControlPacketReceived, ServerResponse


AccessControlPacketSent Event

Applies To

CIFTP

Purpose

The AccessControlPacketSent event fires when CIFTP sends an access control request to an FTP server.

Syntax

Sub CIFTP_AccessControlPacketSent()

Comments

CIFTP issues an access control request when you invoke any method (except CleanupConnection). The FTP protocol requires that the access control channel be used for all requests for data as well as responses to requests between the client and server.

See Also

AccessControlPacketReceived


DataControlChannelClosed Event

Applies To

CIFTP

Purpose

The DataControlChannelClosed event fires when the client receives the data it requested from the server. Once the data is received, the server terminates the data control channel.

Syntax

Sub CIFTP_DataControlChannelClosed()

Comments

If you want to copy multiple files to or from the same FTP server, you must establish another data control channel connection for each file being transferred.

Each of the following methods require that you establishe a data control channel before you can invoke them;

APPE

LIST

RETR

STOR

SendFTPCommand, if the request requires that data be transferred.

See Also

AccessControlChannelClosed, AccessControlChannelConnection, DataControlChannelConnection, FileClosed


DataControlChannelConnection Event

Applies To

CIFTP

Purpose

The DataControlChannelConnection event fires when a data connection to an FTP server is established.

Syntax

Sub CIFTP_AccessControlChannelConnection()

Comments

Use the ConnectToDataControlChannel method to request a data connection to an FTP server. Once the DataControlChannelConnection event fires, your application can request data from the FTP server. You cannot establish a data connection to an FTP server until you establish a connection to an AccessControlChannel connection.

See Also

AccessControlChannelConnection, ConnectToAccessControlChannel, ConnectToDataChannel


DataControlPacketReceived Event

Applies To

CIFTP

Purpose

The DataControlPacketReceived event fires when CIFTP receives a packet, over the data control channel, from the FTP server.

Syntax

Sub CIFTP_DataControlPacketReceived(ByVal Packet As String, ByVal bytes_in As Integer)

Comments

The Packet contains the data received from the server. It can contain a file listing, a directory listing, the contents of a file, or other data depending on the method used to obtain the packet. The bytes_in value is the number of bytes in the current packet.

See Also

AccessControlPacketReceived, AccessControlPacketSent, DataControlPacketSent


DataControlPacketSent Event

Applies To

CIFTP

Purpose

The DataControlPacketSent event provides the size of each outgoing packet that is sent over the data control channel to the FTP server.

Syntax

Sub CIFTP_DataControlPacketSent(ByVal bytes_out As Integer)

Comments

The DataControlPacketSent event fires when CIFTP sends a packet over the data control channel to the FTP server, which allows you to track data that has been sent using progress bars.

The bytes_out value is the number of bytes in the outgoing packet.

Note;  To ensure that you are able to cancel the transfer with CleanupDataConnection, include the DoEvents statement in the DataControlPacketSent event code.

Example

CIFTP1_DataControlPacketSent(ByVal bytes_out As Integer)

' FileSize and BytesSent are module-level variables with a data
' type of Long. FileSize should be set to the size of the file (use
' FileLen) and BytesSent should be set to 0 before calling the STOR
' method.

BytesSent = BytesSent + bytes_out
PercentDone = BytesSent / FileSize

' Use the value in PercentDone to update your progress bar.
DoEvents

End Sub

See Also

AccessControlPacketReceived, AccessControlPacketSent, DataControlPacketReceived


DataPortSet Event

Applies To

CIFTP

Purpose

The DataPortSet event fires when the DataPort property is populated as a result of the PASV method.

Syntax

Sub CIFTP_DataPortSet()

Comments

Once you create an access control connection to an FTP server, you must request that the server provide you with a port number to support data access requests. Use the PASV method to request a data access channel port. Once the server provides the DataPort and you connect to a data channel (call the ConnectToDataControlChannel method and wait for the DataControlChannelConnection event to fire), you can start retrieving and sending data to the FTP server via that port.

See Also

DataPort, PASV


EventStateChanged Event

Applies To

CIFTP

Purpose

The EventStateChanged event fires when the value of the EventState property changes.

Syntax

Sub CIFTP_EventStateChanged(ByVal state As Integer)

Comments

The EventState property records the state of CIFTP; its value changes in response to other CIFTP events. You can test the EventState property to determine a state change and thus initiate an action or control program flow.

The valid EventState property values are listed in the following table and are also in the CITPAK.BAS file.

This event...	has this constant...	with this integer value...
FileClosed	CIFTP_FCLOSED	100
SocketClosed	CIFTP_SCLOSED	101
AccessControlChannelClosed	CIFTP_ACCLOSED	102
DataControlChannelClosed	CIFTP_DCCLOSED	103
AccessControlChannelConnection	CIFTP_ACCONN	104
DataControlChannelConnection	CIFTP_DCCONN	105
DataPortSet	CIFTP_DPORTSET	106
ListBoxesPopulated	CIFTP_LBPOP	107
See Also

EventState


FileClosed Event

Applies To

CIFTP

Purpose

The FileClosed event fires when the file stream (specified by the LocalFileName property) on the client closes. It also fires when all of the data being sent to a file on the FTP server (specified by the RemoteFileName property) has been sent.

Syntax

Sub CIFTP_FileClosed()

Comments

When you are retrieving a file using the RETR method, the FTP server terminates the connection once it has successfully transferred the data to the client. The FileClosed event indicates that communications with the FTP server has terminated and that all data has been retrieved and parsed.

When you are storing a file on the FTP server using the APPE or STOR method, the FileClosed event indicates that all of the data has been sent to the server. Note that there might be a slight delay between the time the data is sent and the time the server actually closes the file.

See Also

DataControlChannelClosed, ListBoxesPopulated, LocalFileName, RemoteFileName


FTPStatus Event

Applies To

CIFTP

Purpose

The FTPStatus event informs the application about the status of high-level methods.

Syntax

Sub CIFTP_FTPStatus(ByVal FTPEvent As Integer, ByVal FTPInfo As Variant)

Comments

The FTPStatus event is fired internally by the CIFTP control when a high-level method is called. The CIFTP control fires the FTPStatus event if there is a change in status while a high-level method is processing. The CIFTP control stops firing the FTPStatus event, after the high-level method completes its processing.

The FTPEvent parameter indicates the type of event and the FTPInfo parameter might contain additional information associated with the event, such as the IP address of the FTP server or the number of bytes being transferred. The FTP parameter can contain a string, a long, or an empty string.

The following table lists the symbolic constants and their meanings for the FTPEvent parameter in the order in which they are fired. These symbolic constants are also in the CIFTP control library. You can view them using the Object Browser.

FTPEvent Parameter Symbolic Constant	Description
FTP_STATUS_RESOLVING_NAME	Resolving host name
FTP_STATUS_NAME_RESOLVED	Host name resolved
FTP_STATUS_CONNECTING_TO_SERVER	Connecting to server
FTP_STATUS_CONNECTED_TO_SERVER	Connected to server
FTP_STATUS_HANDLE_CREATED	File opened
FTP_STATUS_DATA_TRANSFERRED	Data transferred
FTP_STATUS_HANDLE_CLOSING	File closed
FTP_STATUS_CONNECTION_CLOSED	Connection closed
NOTE  	When the FTPEvent is FTP_STATUS_DATA_TRANSFERRED, then the FTPInfo parameter specifies the number of bytes in that block and not the total bytes transferred.

The following example shows you how to get the status of a high-level method that is being processed by the FTP server for debugging purposes;

Sub CIFTP_FTPStatus(ByVal FTPEvent As Integer, ByVal FTPInfo As Variant)
Debug.Print FTPEvent; FTPInfo
End Sub


GotDirectory Event

Applies To

CIFTP

Purpose

The GotDirectory event signals the successful completion of the GetDirectory high-level method.

Syntax

Sub CIFTP_GotDirectory()

Comments

The GotDirectory event fires when the GetDirectory method successfully completes.

See Also

GetDirectory


GotFile Event

Applies To

CIFTP

Purpose

The GotFile event signals the successful completion of the GetFile method.

Syntax

Sub CIFTP_GotFile()

Comments

The GotFile event fires when the GetFile method successfully completes.

See Also

GetFile


InternetError Event

Applies To

CIFTP

Purpose

The InternetError event returns WinInet errors specific to the FTP high-level methods (GetDirectory, GetFile, and PutFile). This event applies only to the 32-bit CIFTP control.

Syntax

Sub CIFTP_InternetError(ByVal error_number As Long, ByVal error_message As String)

Comments

Use the InternetError event to monitor WinInet activity. It fires whenever the FTP server returns an error in response to the GetDirectory, GetFile, and PutFile methods.

The error_number parameter is the error number returned by the FTP server. The error_message parameter is the error text as returned by the FTP server.

You can pass the number that is returned by this InternetError event to the InternetErrDescription function (in CITPAK.BAS) to get a description of the WinInet error. To get an abbreviated description of the WinInet error, you can optionally pass the ConstName parameter.

The following declaration is for the InternetErrDescription function;

Public Function InternetErrDescription(Err As Integer, Optional ByRef ConstName As Variant) As String

NOTE  	You cannot terminate your application (unload forms) within the InternetError event.

See Also

GetDirectory, GetFile, PutFile (method), GotDirectory, GotFile, PutFile (event)


ListBoxesPopulated Event

Applies To

CIFTP

Purpose

The ListBoxesPopulated event fires when the DirectoryListBox and FileListBox objects have been filled.

Syntax

Sub CIFTP_ListBoxesPopulated()

Comments

The ListBoxesPopulated event fires once after the LIST method executes and the ListBox objects are populated. It also fires once after the GetDirectory method executes.

See Also

DirectoryListBoxName, FileListBoxName, LIST


MethodStateChanged Event

Applies To

CIFTP

Purpose

The MethodStateChanged event fires when the value of the MethodState property changes.

Syntax

Sub CIFTP_MethodStateChanged(ByVal state As Integer)

Comments

The MethodState property records the state of CIFTP; its value changes when a CIFTP method is called. You can test the MethodState property to determine a state change and thus initiate an action or control program flow.

The valid MethodState property values are listed in the following table and are also in the CITPAK.BAS file.

This method...	has this constant...	with this integer value...
PASS	CIFTP_PASS	1
USER	CIFTP_USER	2
SYST	CIFTP_SYST	3
TYPE	CIFTP_TYPE	4
LIST	CIFTP_LIST	5
QUIT	CIFTP_QUIT	6
PASV	CIFTP_PASV	7
RETR	CIFTP_RETR	8
STOR	CIFTP_STOR	9
CWD	CIFTP_CWD	10
PWD	CIFTP_PWD	11
NLST	CIFTP_NLST	12
CDUP	CIFTP_CDUP	13
APPE	CIFTP_APPE	14
See Also

MethodState


PutFile Event

Applies To

CIFTP

Purpose

The PutFile event signals the successful completion of the PutFile method.

Syntax

Sub CIFTP_PutFile()

Comments

The PutFile event fires when the PutFile high-level method successfully completes. The InternetError event fires when the PutFile high-level method fails.

See Also

InternetError, PutFile (method)


ServerResponse Event

Applies To

CIFTP

Purpose

The ServerResponse event fires once for each response received from the FTP server.

Syntax

ServerResponse(ResponseCode As Integer,ResponseString As String)

Comments

The ResponseCode parameter is an integer, which represents the three-digit response code from the FTP server (found in the last line of the server's response). You can find a listing of the FTP server response codes in RFC 959. The ResponseString parameter is the actual text from the FTP server, from which the ResponseCode was extracted.

When checking the MethodState property inside of the ServerResponse event, it is important to remember that the MethodState property changes each time you call a method. Therefore, be careful about calling methods either inside or outside of this event. You need to allot enough time for the server's response before calling a subsequent method, especially if you are using the MethodState property to determine programmatic action.

You can also use the ServerResponse event with the SendFTPCommand method to track the progress of any FTP command sent to the FTP server. However, because the MethodState property does not have a constant for the SendFTPCommand, you need to create your own variable to monitor the status of any FTP command sent.

Example

You can use the ResponseCode to programmatically take action based on how the FTP server has responded. In the following example, the MethodState property is used with the ResponseCode in a nested Select Case statement;

Select Case CIFTP1.MethodState
    Case 0
        ' No MethodState yet, must have just connected
        Select Case ResponseCode
            Case 220
                ' The FTP server is ready.
                CIFTP1.USER
            Case Else
                ' Handle non-positive responses as desired.
        End Select
    Case CIFTP_USER
        ' This is a response to the USER command.
        Select Case ResponseCode
            .
            .
            .
End Select

See Also

AccessControlPacketReceived, ConnectToAccessControlChannel


SocketClosed Event

Applies To

CIFTP

Purpose

The SocketClosed event fires when the socket closes.

Syntax

Sub CIFTP_SocketClosed()

See Also

CleanupConnection, CleanupDataConnection


TotalFileBytesReceived Event

Applies To

CIFTP

Purpose

The TotalFileBytesReceived event fires repeatedly as packets are received from the server.

Syntax

Sub CIFTP_TotalFileBytesReceived(ByVal bytes_in As Long)

Comments

The bytes_in value is the total number of bytes received during the file transfer. It increments each time a packet is received. Use bytes_in as the byte counter for the file transfer.

See Also

FileClosed, LIST, RETR


WSAError Event

Applies To

CIFTP

Purpose

The WSAError event fires when CIFTP receives a WinSock error.

Syntax

Sub CIFTP_WSAError(ByVal error_number As Integer)

Comments

Use the WSAError event to monitor the WinSock activity. The error_number identifies the WinSock error that occurred. These errors are listed in the CITPAK.BAS file.

You can pass the number that is returned by this WSAError event to the WSAErrDescription function (in CITPAK.BAS) to get a description of the WinSock error. To get an abbreviated description of the WinSock error, you can optionally pass the ConstName parameter.

The following declaration is for the WSAErrDescription function;

Public Function WSAErrDescription(Err As Integer, Optional ByRef ConstName As Variant) As String


APPE Method

Applies To

CIFTP

Purpose

The APPE method requests that the FTP server append a file from the client to a file on the server.

Syntax

CIFTP.APPE

Data Type

None

Comments

The APPE method copies the file identified by the LocalFileName property to the FTP server. The FTP server stores it in the location specified by the RemoteFileName property.

If the file already exists, the FTP server appends the existing file with the new file. If the file does not exist, it is created.

The following events fire when the APPE method completes;

EventStateChanged

FileClosed

SocketClosed

NOTE  	You might not have access privileges to copy files onto a particular FTP server.

See Also

STOR, LocalFileName, RemoteFileName, SocketClosed, EventStateChanged, FileClosed


CDUP Method

Applies To

CIFTP

Purpose

The CDUP method requests that the server change the current working directory to its parent directory.

Syntax

CIFTP.CDUP

Data Type

None

Comments

If the current directory is the root directory, this command has no effect.

See Also

CWD


CleanupConnection, CleanupDataConnection Methods

Applies To

CIFTP

Purpose

The CleanupConnection method closes the socket opened by the ConnectToAccessControlChannel method and cleans up WinSock.

The CleanupDataConnection method closes the socket opened by the ConnectToDataChannel method and cleans up WinSock.

Syntax

CIFTP.CleanupConnection
CIFTP.CleanupDataChannelConnection

Data Type

None

Comments

By default, CIFTP opens the socket when you invoke the ConnectToAccessControlChannel method and the ConnectToDataChannel method. CIFTP closes the socket when you issue the QUIT method.

Use CleanupConnection and CleanupDataConnection to clear errors that might occur when a method fails, or in situations when the socket does not close properly, and you need to reconnect to the server. The CleanupConnection and CleanupDataConnection methods cause the SocketClosed event to fire.

Use these methods only as a last resort.

See Also

ConnectToAccessControlChannel, QUIT, WSAError, SocketClosed


ConnectToAccessControlChannel Method

Applies To

CIFTP

Purpose

The ConnectToAccessControlChannel method establishes a connection to the FTP server's access control channel. The access control channel passes requests and replies (but no data) between client and server.

Syntax

Result = CIFTP.ConnectToAccessControlChannel

Data Type

Integer

Comments

Use the ConnectToAccessControlChannel method to request a connection to an FTP server. When the method succeeds, the AccessControlChannelConnection event fires, and your application can start to interact with the FTP server. You cannot retrieve data from an FTP server until you also establish a data channel connection with the ConnectToDataChannel method.

To establish a connection you must set the HostName or HostAddress and the AccessPort properties. When the connection attempt succeeds, Result is an integer that represents the socket number opened by the ConnectToAccessControlChannel method. The return of a socket number does not indicate successful connection; rather the AccessControlChannelConnection event fires when the connection attempts succeeds. When the connection attempt fails, Result is 0 and the WSAError event fires.

See Also

AccessControlChannelConnection, AccessPort, ConnectToDataChannel, PASV, WSAError


ConnectToDataChannel Method

Applies To

CIFTP

Purpose

The ConnectToDataChannel method establishes a connection to a data channel. The data control channel passes data between client and server.

Syntax

Result = CIFTP.ConnectToDataChannel

Data Type

Integer

Comments

Use the ConnectToDataChannel method to request a data connection to an FTP server.

You cannot establish a data channel connection until you first establish an access control channel (ConnectToAccessControlChannel method) and receive a port number (DataPort property) for the data access channel to use from the FTP server (PASV method).

When the ConnectToDataChannel method succeeds, Result is an integer that represents the socket number opened by the ConnectToDataControlChannel method. The return of a socket number does not indicate a successful connection; rather the DataChannelConnection event fires when the connection attempts succeeds. When the connection attempt fails, Result is 0 and the WSAError event fires.

See Also

AccessControlChannelConnection, AccessPort,  ConnectToAccessControlChannel, DataPort, PASV, WSAError


CWD Method

Applies To

CIFTP

Purpose

The CWD method requests that the server change the current working directory.

Syntax

CITFP.CWD

Data Type

None

Comments

Set the WorkingDirectory property before calling the CWD method. The following code sample illustrates how you might verify that the FTP server was able to change to the new directory.

' Set the WorkingDirectory property to the directory that you want as ' a working directory and invoke the CWD method.

NewDir = /pub/crescent
CIFTP1.WorkingDirectory = NewDir
CIFTP1.CWD

' Fetch the server's current working directory using the PWD method.
' Set the WorkingDirectory property to an empty string before
' invoking the PWD method, so you can tell when the PWD method has
' assigned a new value to the working directory.

CIFTP1.WorkingDirectory =
CIFTP1.PWD

' Loop until PWD has assigned the current working directory
' /pub/crescent to the WorkingDirectory property

Do While CIFTP1.WorkingDirectory =

    DoEvents
Loop

If WorkingDirectory = NewDir, you've succeeded, otherwise the server could not change to the directory in NewDir.

See Also

PWD, WorkingDirectory


GetDirectory Method

Applies To

CIFTP

Purpose

The GetDirectory method obtains a directory listing from an FTP server.

Syntax

CITFP.GetDirectory

Data Type

Integer

Comments

The GetDirectory method is a high-level method which performs the equivalent action of five low-level methods needed to obtain a directory listing from an FTP server. The GetDirectory method uses routines from the WININET.DLL to perform actions equivalent to calling the following methods in this order; ConnectToAccessControlChannel, USER, PASS, LIST, and QUIT. Note that these five methods are never called and their events never fire. To monitor the status of the GetDirectory method, use the FTPStatus event.

Because WININET.DLL does not support custom ports, the GetDirectory method can connect only to the default port (usually port 21). The method ignores the AccessPort property value.

Set these properties before calling GetDirectory; AccessPort, FileListBoxName, DirectoryListBoxName, HostName (or HostAddress), LoginName, Password, RepresentationType, WorkingDirectory.

GetDirectory populates the FileListBox, DirectoryListBox objects, and the Files collection.

When GetDirectory method succeeds, the GotDirectory event fires. When the GetDirectory method fails the InternetError event fires.

NOTE  	The CIFTP16.OCX does not support the GetDirectory method.

See Also

AccessPort, ConnectToAccessControlChannel, DirectoryListBoxName, FileListBoxName, FTPStatus, GotDirectory, HostAddress, HostName InternetError, LIST, LoginName, PASS, Password, QUIT, RepresentationType, USER, WorkingDirectory


GetFile Method

Applies To

CIFTP

Purpose

The GetFile method retrieves a file from an FTP server.

Syntax

CITFP.GetFile

Data Type

None

Comments

The GetFile method is a high-level method which performs the equivalent action of nine low-level methods needed to retrieve a file. The GetFile method uses routines from the WININET.DLL to perform actions equivalent to calling the following methods in this order; ConnectToAccessControlChannel, USER, PASS, PASV, ConnectToDataAccessChannel, TYPE, RETR, QUIT. Note that these eight methods are never called and their events never fire. To monitor the status of the GetFile method, use the FTPStatus event.

Because WININET.DLL does not support custom ports, the GetFile method can connect only to the default port (usually port 21). The method ignores the AccessPort property value.

Set these properties before calling the GetFile method; AccessPort, HostName (or HostAddress), LocalFileName, LoginName, Password, RemoteFileName, RepresentationType, and WorkingDirectory.

When the GetFile method succeeds, the GotFile event fires. When the GetFile method fails, the InternetError event fires.

If the OverwriteExistingFile property is set to False and a local file already exists with the same name that is specified by the LocalFileName property, the GetFile method generates a WinInet error of 80, File Exists.

NOTE  	The CIFTP16.OCX does not support the GetFile method.

See Also

AccessPort, ConnectToAccessControlChannel, ConnectToDataChannel, FTPStatus, GotFile, HostAddress, HostName, InternetError, LocalFileName, LoginName, OverwriteExistingFile, PASS, Password, PASV, QUIT, RemoteFileName, RepresentationType, RETR, TYPE, USER, WorkingDirectory


LIST Method

Applies To

CIFTP

Purpose

The LIST method requests a directory listing of the current working directory from the FTP server.

Syntax

CITFP.LIST

Data Type

None

Comments

Set the DirectoryListBoxName property and the FileListBoxName property before calling the LIST method, if you want the results of the request to populate a ListBox object.

The LIST method also populates the Files collection.

The working directory is the directory to which you are currently logged in.

NOTE  	If you specified a file name in the LocalFileName property, the directory listing is written to this file.

See Also

CDUP, CWD, DirectoryListBoxName, LocalFileName


PASS Method

Applies To

CIFTP

Purpose

The PASS method is part of the login procedure along with the USER method. It provides the FTP server with the login's password.

Syntax

CIFTP.PASS

Data Type

None

Comments

Set the Password property before calling the PASS method. Call the PASS method immediately after USER. The combination of USER and PASS identifies the user to the FTP host server.

See Also

LoginName, Password, USER


PASV Method

Applies To

CIFTP

Purpose

The PASV method requests a data port from the FTP server.

Syntax

CIFTP.PASV

Data Type

Integer

Comments

PASV updates the DataPort property. It is this port that the client and FTP server will use for the data control channel. When the DataPortSet event fires, the DataPort property sets.

The PASV and PORT methods both result in establishing a data port. Many FTP servers support either the PORT or PASV method. You might need to try both methods to determine which one your FTP server supports.

See Also

ConnectToDataChannel, DataPortSet, PORT method


PORT Method

Applies To

CIFTP

Purpose

The PORT method specifies an FTP server data port. The server uses the port to connect to the CIFTP client.

Syntax

CIFTP1.PORT

Data Type

None.

Comments

You must set the DataPort property before you call the PORT method.

The PASV and PORT methods both result in establishing a data port. Many FTP servers support either the PORT or PASV method. You might need to try both methods to determine which one your FTP server supports.

See Also

PASV, ConnectToDataChannel


PutFile Method

Applies To

CIFTP

Purpose

The PutFile method sends a file to an FTP server.

Syntax

CIFTP.PutFile

Data Type

Integer

Comments

The PutFile method is a high-level method which performs the equivalent action of nine low-level methods needed to write a file to an FTP server. The PutFile method uses routines from the WININET.DLL to perform actions equivalent to calling the following methods in this order ConnectToAccessControlChannel, USER, PASS, PASV, ConnectToDataAccessChannel, TYPE, RETR, QUIT. Note that these eight methods are never called and their events never fire. To monitor the status of the PutFile method, use the FTPStatus event.

Because WININET.DLL does not support custom ports, the PutFile method can connect only to the default port (usually port 21). The method ignores the AccessPort property value.

Set these properties before calling PutFile; AccessPort, HostName (or HostAddress), LocalFileName, LoginName, Password, RemoteFileName, RepresentationType, and WorkingDirectory. Note that the events for these methods do not fire.

When the PutFile method succeeds, the PutFile event fires. When the PutFile method fails, the InternetError event fires.

NOTE  	The CIFTP16.OCX does not support the PutFile method.

See Also

AccessPort, ConnectToAccessControlChannel, ConnectToDataChannel, FTPStatus, HostAddress, HostName, InternetError, LocalFileName, LoginName, PASS, Password, PASV, QUIT, RemoteFileName, RepresentationType, RETR, STOR, SYST, TYPE, USER, WorkingDirectory


PWD Method

Applies To

CIFTP

Purpose

The PWD method requests that the server print the current working directory.

Syntax

CIFTP.PWD

Data Type

None

Comments

PWD updates the WorkingDirectory property.

See Also

CWD,WorkingDirectory


QUIT Method

Applies To

CIFTP

Purpose

The QUIT method requests that the connection to the FTP server be terminated.

Syntax

CIFTP.QUIT

Data Type

None

Comments

QUIT notifies the FTP server that the client is done. and the server closes the access control channel connection.

If a file transfer is in progress, the FTP server waits until it is complete and then closes the channel.

See Also

ConnectToAccessControlChannel


RETR Method

Applies To

CIFTP

Purpose

The RETR method copies a file from the FTP server to the client.

Syntax

CIFTP.RETR
If GetAttr (filename And (vbReadOnly Or vbDirectory) Then
'file is either read-only or a directory, cannot retrieve it
'add error handling code here
Else
'OK to retrieve file, add code here
End If

Data Type

None

Comments

Set the RemoteFileName property before calling the RETR method. RETR updates the file identified by the LocalFileName property. If the file does not exist, or the user does not have privileges to the file, the server does not return any data to the client and the DataControlPacketReceived event does not fire.

The following events fire in this order after the RETR method completes;

1.	EventStateChanged

2.	FileClosed

3.	DataControlChannelClosed

4.	SocketClosed

See Also

DataControlChannelClosed DataControlPacketReceived, EventStateChanged, FileClosed, LocalFileName, RemoteFileName


SendFTPCommand Method

Applies To

CIFTP

Purpose

The SendFTPCommand method requests that the server issue FTP commands. Use this method to issue commands not implemented as CIFTP methods.

Syntax

CIFTP.SendFTPCommand(Packet As String)

Data Type

String

Comments

The Packet is the FTP command that you want to issue. It has this format;
FTPCommand

Where FTPCommand is the actual command that you want to issue. If the FTP command that you issue takes parameters, the command and parameters must be separated by a space. When you call the SendFTPCommand method the PacketSent event fires.

Example

To get an FTP server to return a list of commands it supports, you might call the SendFTPCommand method as follows;

CIFTP.SendFTPCommand Help

See Also

ConnectToAccessControlChannel, ConnectToDataChannel


STOR Method

Applies To

CIFTP

Purpose

The STOR method requests that the FTP server accept a file from the client.

Syntax

CIFTP.STOR

Data Type

None

Comments

STOR copies the file identified by the LocalFileName property to the FTP server. The FTP server stores it in the location specified by the RemoteFileName property.

If the file already exists, the FTP server overwrites the existing file with the new file. If the file does not exist, it is created.

The following events fire in this order when the STOR method completes;

EventStateChanged

FileClosed

DataControlChannelClosed

SocketClosed

NOTE  	You might not have access privileges to deposit files onto a particular FTP server.

See Also

APPE, DataControlChannelClosed LocalFileName, RemoteFileName, SocketClosed, EventStateChanged, FileClosed


SYST Method

Applies To

CIFTP

Purpose

The SYST method asks the FTP server to identify its operating system, for example, Windows NT or UNIX.

Syntax

CIFTP.SYST

Data Type

None

Comments

The SYST method is ignored by Versions 3.0 and 4.0 Internet ToolPak controls. This method is for backward compatibility purposes only.

See Also

DirectoryListBoxName, FileListBoxName


TYPE Method

Applies To

CIFTP

Purpose

The TYPE method requests that the server translate the data into a specified format before passing it to the client.

Syntax

CIFTP.TYPE

Data Type

None

Comments

Set the RepresentationType property before calling the TYPE method. RepresentationType has these values;

Use this value...	to retrieve this kind of data...
A	ASCII
I	Binary
E	EBCDIC
See Also

RepresentationType


USER Method

Applies To

CIFTP

Purpose

The USER method is part of the login procedure along with the PASS method. It provides the FTP server with the login's username.

Syntax

CIFTP.USER

Data Type

Integer

Comments

Set the LoginName property before calling the USER method.

Call USER after the AccessControlChannelConnection event fires. Call PASS immediately after USER. The combination of USER and PASS identifies the user to the FTP host server.

NOTE  	Your application's users must have an account on the FTP server with the appropriate access level to the files that the application accesses. Some FTP servers support a user name of anonymous. Anyone can login as anonymous, but they might have limited privileges.

See Also

LoginName, PASS, Password


Files Collection

Control Files

CIFTP.OCX
CIFTP16.OCX

Purpose

The Files collection contains the current collection of File objects.

Object Type

Files collection

Comments

A Files collection contains File objects that represent one or more files or directories available on an FTP server. It gives your program read-only access to the attributes of the File object.

The Files collection has the Count property and the Item method, which behave like they do in other standard Visual Basic collections. However, the Add and Remove methods are not implemented for the Files collection.

NOTE  	The Files collection does not perform error checking for invalid access to a collection or for invalid uses of a collection. This means that your code must handle common run-time errors, such as RT91 (Object Variable or With Block Variable Not Set).

Properties

Count

Methods

Item

See Also

File object, Files (property)


Count Property

Applies To

Files collection

Purpose

Returns the number of File objects in a Files collection.

Syntax

CIFTP.Files.Count

Data Type

Long

Usage

Read-only at run time. Unavailable at design time.

Comments

Use the Count property to determine the number of files in a collection.

Members of a collection are numbered starting with 0, so you should code loops starting with the 0 member; as shown in the following code example;

Dim i As Long
For i = 1 to CIFTP1.Files.Count - 1
' Work with CIFTP1.Files(i) here...
Next i

You can also use the For Each object In collection syntax to enumerate all of the members in a collection, as shown in the following code example;

Dim myColFiles As Files

For Each myColFiles In CIFTP1.Files
' Work with File object here...
Next

If the Count property is 0, then there are no File objects in the collection.

See Also

File object, Files collection


Item Method

Applies To

Files collection

Purpose

Returns the File object at the specified index in the Files collection.

Syntax

Set MyFile = CIFTP.Files(1)
Set MyFile = CIFTP.Files(somefile.txt)
Set MyFile = CIFTP.Files.Item(1)
Set MyFile = CIFTP.Files.Item(somefile.txt)

Return Type

File object

Comments

You can index an item (File object) in the Files collection using its offset or the value of its FileName property. The valid range for an offset starting from 0 to the integer specified in the Count property minus 1.

If you specify an invalid index, you get the following error message;

Run-time error '9';Subscript out of range

When you index a File object by its name, the indexing is case sensitive.

The following code example shows how to retrieve file attributes for files in a collection using the For Each syntax.

Public Sub GetCollection()

'Declare myColFiles as a File object
Dim myColFiles As File
' Open a log for appending the attributes of the files in a
' collection
Open c;\FTP\collection.log For Append Access Write As #1
' Write the attributes for each file in a collection to a log
Write #1, Number of items in Collection; ; CIFTP1.Files.Count
    For Each myColFiles In CIFTP1.Files
       Write #1, AltName= ; myColFiles.AltName
       Write #1, Attributes= ; myColFiles.Attributes
       Write #1, FileDate= ; myColFiles.FileDate
       Write #1, FileName= ; myColFiles.filename
       Write #1, FileSize= ; myColFiles.FileSize
    Next
    Close #1
End Sub

See Also

Count, File object, Files collection, Help topic on the Collection Object in the Visual Basic Help system


File Object

Control Files

CIFTP.OCX
CIFTP16.OCX

Object Type

File object

Comments

A File object represents a file on an FTP server. The following table lists the properties of the File object. These properties represent the attributes of the file on an FTP server.

Property	Data Type	Description
AltName	String	Reserved for future use.
Attributes	Long	Bit mask of the file attributes.  Currently, the only attributes that an FTP server returns are 16, which represents a directory and 128, which represents all files.
FileDate	Variant	Date and time the file or directory was created. For UNIX hosts, if the directory or file is older than 6 months, then the creation date is returned without the time.
FileName	String	Name of the file.
FileSize	Variant	Size of the file. The data type for FileSize is a Long if the file is less than two GBytes. If the file is greater than two GBytes, then the data type is Currency.
See Also

Files collection


General Tab

Applies To

CIFTP

This custom tab lets you set these custom properties:

FTP Configuration:

AccessPort Property	DataPort Property	HostName Property
HostAddress Property	LoginName Property	Password Property
Transaction Related:

LocalFileName Property	RemoteFileName Property	RepresentationType Property
WorkingDirectory Property


SoundEvents Tab

Applies To

CIFTP

This custom tab lets you associate sounds to custom events. The following table lists the hidden properties that define the sound object and the event to which they are applied:

Event	Hidden Property
AccessControlChannelConnection Event	AccessControlChannelWAV
AccessControlChannelClosed Event	AccessChannelClosedWAV
DataControlChannelConnection Event	DataChannelConnectionWAV
DataControlChannelClosed Event	DataChannelClosedWAV
FileClosed Event	FileClosedWAV
ListBoxesPopulated Event	ListBoxesPopulatedWAV
SocketClosed Event	SocketClosedWAV
	WSAErrorEventWAV
You can set the sound associations at design time or run time. You can test the sounds from within the property page. At run time, an event is fired and a sound is played asynchronously where an association is made.

To associate a sound, you can type in the full qualified path for any events you want to associate or click the "Browse..." button and select it from the dialog box. After you enter a sound, you can click the test button to hear it. If the sound file is invalid or missing you will hear nothing when you click "Test".


Related Topics

What Is FTP?
How Does FTP Work?
What Is the CIFTP Control?
Using High and Low-level Methods in the Same Application
Programming Tasks
Connecting to an FTP Server Using Low-level Methods
Disconnecting From an FTP Server
Copying a File From an FTP Server Using Low-level Methods
Copying a File From an FTP Server Using High-level Methods
Obtaining a Directory Listing from an FTP Server Using Low-level
Obtaining a Directory Listing from an FTP Server Using High-level
Connecting to an FTP Server Using Low-level Methods
Copying a File to an FTP Server Using High-level Methods
Using an FTP Proxy Server
Using the CIFTP Wrapper Class
Public Functions
Public Properties
Public Subs
Public Data Members

Back to the CIFTP Reference


What Is FTP?
Related Topics

File Transfer Protocol (FTP) is an Internet Protocol used to copy files between computers without regard for operating system imposed differences in the file's structure. You can use FTP to copy text or binary files.


How Does FTP Work?
Related Topics

FTP uses a two channel model to transfer data. One channel passes the commands/requests between the client and host machines (this is known as the access channel); while the other channel passes the data between client and host (this is known as the data channel). Once you open the access channel, it stays open until the client notifies the server to close it. The data channel is opened and closed in response to specific data transfer requests. For example, if you want to copy a file from a host to a local workstation, you open the access channel and request the file. The server then opens the data channel and copies the file to the local machine. When the file transfer is complete, the server closes the data channel. To copy another file, you make the request via the access channel. The server opens another data channel, copies the file and closes the new data channel. The access channel remains constant while data channels are created and destroyed throughout the session in response to requests.

By default, FTP servers listen for access requests on port 21. When the client requests a file from the server, the client tells the server what port number the server should use to pass data to the client. The server connects to that port on the client system and downloads the files via that port.

FTP is a transaction oriented protocol (like HTTP). After you request data and the server returns it, the connection to the data channel terminates.


What Is the CIFTP Control?
Related Topics

The Crescent Internet ToolPak File Transfer Protocol (CIFTP) control lets Visual Basic programmers build customized FTP client applications that can copy files to and from FTP servers. The CIFTP control complies with the FTP standards defined in RFC 959. You can use the FTP control to perform any valid FTP function. You might use it to build applications like these;

Build a Visual Basic application that monitors Visual Basic SourceSafe for the latest software builds. When the application detects a new build, the application copies the build from SourceSafe to an FTP server where it can be accessed by users and testers.

Build a Visual Basic application that monitors an FTP site for new files. As new files appear at the FTP site, they can be emailed to specified users. (Integrate CIFTP and CISMTP.)

Build a Visual Basic application that performs FTP functions but provides the functionality in a way that users do not need to know the FTP commands.

CIFTP has a simple programming interface in which you set property values and call methods to perform the desired tasks. The methods (which generally do not take arguments) take the necessary data directly from the property settings, and submits the request to the server. When the server returns its response, the control parses the data and updates the appropriate properties or populates a ListBox. You can simply read the data from a property value or a ListBox object.

When the server passes data to the client in response to a request from CIFTP, it passes the data in stream mode. Stream mode transfers open a dedicated channel for a single file transfer and closes it when at the end of the file. The data is passed as a raw stream of bytes.

CIFTP supports two types of methods; low-level and high-level. A low-level method performs a single function like providing a single piece of information to the FTP server, such as a password. A complete task, therefore, is comprised of multiple low-level method calls. A high-level method performs a complete task. In a single method call, a high level method performs the equivalent action of all of the low-level methods necessary to complete a task, thus significantly reducing the amount of code that you must write. CIFTP includes three high-level methods; GetDirectory, GetFile, and PutFile. Only the CIFTP.OCX (32-bit) supports the high-level methods. The high-level methods are not available for the CIFTP16.OCX. This is because the high-level methods use the Microsoft WININET.DLL, which is 32-bit only.


Using High and Low-level Methods in the Same Application
Related Topics

When using high and low-level methods in the same application, you need to remember that they are implemented using different APIs. The high-level methods use the Microsoft WinInet API to implement their functions; whereas, the low-level methods use the Microsoft WinSock API. Therefore, a connection that a high-level method makes to the FTP server is a separate and distinct connection from one that a low-level method might make.

When you are using low-level methods, you are responsible for obtaining your own access control channel and data control channel, if you want to transfer data. In contrast, the high-level methods automatically obtain the access and data control channels for you. As a result of hiding the details from you, you cannot directly access either the access or data control channels created by a high-level method.


Programming Tasks
Related Topics

The following topics describe how to program some simple tasks with the CIFTP control.

Connecting to an FTP Server Using Low-level Methods

Disconnecting From an FTP Server

Copying a File From an FTP Server Using Low-level Methods

Copying a File From an FTP Server Using High-level Methods

Obtaining a Directory Listing from an FTP Server Using Low-level

Obtaining a Directory Listing from an FTP Server Using High-level

Copying a File to an FTP Server Using Low-level Methods

Copying a File to an FTP Server Using High-level Methods

Using an FTP Proxy Server

Using the CIFTP Wrapper Class

Each topic lists the properties that you must set, and the methods that you must call to perform a specific task, and identifies the events that are fired. A code fragment that illustrates the task follows the task list.


Connecting to an FTP Server Using Low-level Methods
Related Topics

When you connect to an FTP server using low-level methods, you are responsible for establishing access and data control channels. Most methods, however, only require an access channel. The methods that require a data control channel include; APPE, LIST, RETR, SendFTPCommand, and STOR.

Each client application must contain code that first connects to an FTP server and opens the access control channel. Once the access control channel is open (Steps 1-3) and the data control channel is established (Steps 4-6), then the client can request data from the FTP Server.

Here are the steps:

1.	Set these properties:
HostName (or HostAddress)
AccessPort
LoginName
Password

2.	Call the ConnectToAccessControlChannel method.

3.	When the AccessControlChannelConnection event fires, call the following methods in this order:
USER
PASS

The FTP server returns a code of 230, when you have successfully connected to the server and have established an access control channel.

4.	Call the PASV method.

5.	When the DataPortSet event fires, call the ConnectToDataChannel method.

6.	When the DataControlChannelConnection event fires, invoke any of the methods listed or the SendFTPCommand method for an FTP command not explicitly supported.

Here is what the code looks like:

Form_Load

CIFTP1.HostName = ftp.myhost.com
CIFTP1.AccessPort = 21
CIFTP1.LoginName = MyName
CIFTP1.Password = MyPass
CIFTP1.ConnectToAccessControlChannel

CIFTP1_AccessControlChannelConnection()
CIFTP1.USER
CIFTP1.PASS
CIFTP1.PASV

CIFTP1_DataPortSet()
CIFTP1.ConnectToDataChannel

CIFTP1_DataControlChannelConnection()

'Call any method here...


Disconnecting From an FTP Server
Related Topics

If you have an active access control channel and have performed all of the FTP tasks that you want with the FTP server, end the FTP session by calling the QUIT method. When QUIT completes, the following occurs, CIFTP fires the AccessControlPacketSent event and the server issues a response to the client. When the client receives the response, the AccessControlChannelClosed and SocketClosed events fire.

Here is what the code looks like:

CIFTP1.QUIT


Copying a File From an FTP Server Using Low-level Methods
Related Topics

Once you have established a connection to the access control channel and the data control channel, you can perform any FTP command such as copying a file from the FTP Server. (See the Connecting to an FTP Server Using Low-Level Methods topic for the connection steps.)

Here are the steps:

1.	Once you are connected and the DataControlChannelConnection event fires, set the following properties:
RemoteFileName
LocalFileName
RepresentationType

2.	Call the TYPE method. This is an optional step. You need to call this method only if you want to change the representation type.

3.	Call the RETR method.

When the RETR completes, CIFTP fires the AccessControlPacketSent event.

When the client receives the data from the server, the CIFTP control fires the AccessControlPacketReceived and the DataControlPacketReceived events.The control writes the data to the file named by the LocalFileName property.

After the data is written to the local file, the FileClosed event fires and the DataControlChannelClosed and the TotalFileBytesReceived events fire.

Here is what the code looks like:

CIFTP1_DataControlChannelConnection()
CIFTP1.RemoteFileName = accounts.dat
CIFTP1.LocalFileName = C:\Myfile.dat
CIFTP1.RepresentationType = A
CIFTP1.TYPE
CIFTP1.RETR


Copying a File From an FTP Server Using High-level Methods
Related Topics

The high-level method GetFile automatically connects to the access and data control channels. You only need to set the necessary properties before you call the GetFile method.

The GetFile method uses the Microsoft WININET.DLL to retrieve a file from the FTP server. Note that no low-level methods are called.

Here are the steps:

1.	Set these properties:
AccessPort
HostName (or HostAddress)
LocalFileName
LoginName
Password
RemoteFileName
RepresentationType
WorkingDirectory

2.	Call the GetFile method.

When the GetFile method successfully completes, the CIFTP control fires the GotFile event. If the GetFile method is unsuccessful, the InternetError event fires. You can monitor the status of the GetFile method using the FTPStatus event, which fires when the GetFile method is called.

The CIFTP control writes the data to the file named by the LocalFileName property.

Here is what the code looks like:

Form_Load
CIFTP1.HostName = ftp.myhost.com
CIFTP1.AccessPort = 21
CIFTP1.LoginName = MyName
CIFTP1.Password = MyPass
CIFTP1.RemoteFileName = accounts.dat
CIFTP1.LocalFileName = C:\Myfile.dat
CIFTP1.RepresentationType = A
CIFTP1.TYPE
CIFTP1.WorkingDirectory = /pub
CIFTP1.GetFile


Obtaining a Directory Listing from an FTP Server Using Low-level
Obtaining a Directory Listing from an FTP Server Using Low-level Methods
Related Topics

Once you have established a connection to the access control channel and the data control channel, you can perform any FTP command such as obtaining a directory listing. (See the Connecting to an FTP Server Using Low-Level Methods topic for the connection steps.)

Here are the steps:

1.	Once you are connected and the DataControlChannelConnection event fires, set these properties:
DirectoryListBoxName
FileListBoxName
RepresentationType
WorkingDirectory

2.	Call the TYPE method. This is an optional step. You need to call this method only if you want to change the representation type.

3.	Call the LIST method.

After you call the LIST method, the AccessControlPacketSent event fires. When the server responds the following events fire:
AccessControlPacketReceived
DataControlPacketReceived
MethodStateChanged
TotalFileBytesReceived (multiple times).

After all of the data is received the following events fire:
DataControlChannelClosed event fires
MethodStateChanged
ListBoxesPopulated
FileClosed
TotalFileBytesReceived If the LIST method fails, the WSAError event fires.

Here is what the code looks like:

Set CIFTP1.DirectoryListBoxName = lstDirs
Set CIFTP1.FileListBoxName = lstFiles
CIFTP1.RepresentationType = A
CIFTP1.TYPE
CIFTP1.WorkingDirectory = /pub
CIFTP1.LIST


Obtaining a Directory Listing from an FTP Server Using High-level
Obtaining a Directory Listing from an FTP Server Using High-level Methods
Related Topics

The high-level method GetDirectory performs all of the necessary connection to the data control and access control channels. You must simply set the necessary properties before calling GetDirectory.

Here are the steps:

1.	Set these properties:
AccessPort
FileListBoxName
DirectoryListBoxName
HostName (or HostAddress)
LocalFileName
LoginName
Password
RemoteFileName
RepresentationType
WorkingDirectory

2.	Call the GetDirectory method.

If the GetDirectory method succeeds, the GotDirectory event fires and the Directory and File ListBox objects are populated with the requested data. If the GetDirectory method fails, the InternetError event fires.


Copying a File to an FTP Server Using Low-level Methods
Related Topics

Once you have established a connection to the access control channel and the data control channel, you can perform any FTP command such as copying a file to an FTP Server. (See the Connecting to an FTP Server Using Low-Level Methods topic for the connection steps.)

Here are the steps:

1.	Once you are connected and the DataControlChannelConnection event fires, set the following properties:
RemoteFileName
LocalFileName
RepresentationType

2.	Call the TYPE method. This is an optional step. You need to call this method only if you want to change the representation type.

3.	Call the STOR method.

When the STOR method completes, CIFTP fires the following events; EventStateChanged, FileClosed, DataControlChannelClosed, SocketClosed.

You can monitor the progress of the STOR method using the ServerResponse event, which fires one or more times after the STOR method is called.

When the client copies the data to the server, the CITFP control fires the AccessControlPacketSent event. The control writes the data to the file named by the RemoteFileName property.

After the data is written to the remote file, the FileClosed event fires and the DataControlChannelClosed events fire.

Here is what the code looks like:

CIFTP1_DataControlChannelConnection()
CIFTP1.RemoteFileName = accounts.dat
CIFTP1.LocalFileName = C:\Myfile.dat
CIFTP1.RepresentationType = A
CIFTP1.TYPE
CIFTP1.STOR


Copying a File to an FTP Server Using High-level Methods
Related Topics

The high-level method PutFile automatically connects to the access and data control channels. You only need to set the necessary properties before you call the PutFile method.

The PutFile method uses the Microsoft WININET.DLL to copy a file to the FTP server. Note that no low-level methods are called.

Here are the steps:

1.	Set these properties:
AccessPort
HostName (or HostAddress)
LocalFileName
LoginName
Password
RemoteFileName
RepresentationType
 WorkingDirectory

2.	Call the PutFile method.

When the PutFile method successfully completes, the CIFTP control fires the PutFile event. If the PutFile method is unsuccessful, the InternetError event fires. You can monitor the status of the PutFile method using the FTPStatus event, which fires when the PutFile method is called.

The CIFTP control writes the data to the file named by the RemoteFileName property.

Here's what the code looks like:

Form_Load
CIFTP1.HostName = ftp.myhost.com
CIFTP1.AccessPort = 21
CIFTP1.LoginName = MyName
CIFTP1.Password = MyPass
CIFTP1.RemoteFileName = accounts.dat
CIFTP1.LocalFileName = C:\Myfile.dat
CIFTP1.RepresentationType = A
CIFTP1.WorkingDirectory = /pub
CIFTP1.PutFile


Using an FTP Proxy Server
Related Topics

The CIFTP control enables you to designate a proxy server. You cannot use HTTP proxies with the CIFTP control. Since HTTP proxies emulate FTP to enable Web browsers to retrieve files and directory listings from FTP servers, you should be sure that the server is a true FTP proxy. If you connect to the proxy on port 80, 8080, or 8181, the server is probably an HTTP proxy. If you connect on port 21 or 2121, the server is probably an FTP proxy.

To use an FTP proxy server, follow these steps:

1.	Set .HostName to the name of the proxy server.

2.	Specify .LoginName with the following syntax:

username@ftpserver

where username is the user name associated with the destination FTP server, and ftpserver is the name of the destination FTP server.

If the proxy server uses a custom port, you must set the AccessPort property to the custom port value.

You might want your application to support both a destination FTP server and an FTP proxy server. The following sample code accomplishes this;

' MyProxy holds name of proxy server
' MyFtpServer holds the name of the destination FTP server
'MyName holds the user name

If Len (MyProxy) Then
CIFTP4.HostName = MyProxy
CIFTP4.LoginName = MyName & @ & MyFTPServer
Else
CIFTP4.HOSTNAME = MyFTPServer
CIFTP4.LoginName = MyName
End If


Using the CIFTP Wrapper Class
Related Topics

The clsFTP class is a wrapper class that simplifies the use of the CIFTP control. Its public interface offers functions similar to the control's high level methods (HLMs). Unlike the HLMs, however, these are available to both 16 and 32 bit CIFTP controls. In addition to hiding many of the complexities of using the asynchronous low level methods, the class offers error handling capabilities. You can also use the class to modify the control to suit your requirements.

The return values of all public functions that return a boolean are either True (the function was successful) or False (an error occurred). Use the sGetLastError function to determine the error condition.


Public Functions
Related Topics

bInit (FTP As CIFTP) As Boolean
BLogin (Optional vntHostName, Optional vntLoginName, Optional vntPassword, Optional vntWorkingDirectory) as BooleanBGetFile (Optional vntLocalFileName, Optional vntRemoteFileName, Optional vntBinaryFile) As Boolean bPutFile(Optional vntLocalFileName, Optional vntRemoteFileName, Optional vntBinaryFile, Optional vntAppend) As Boolean
bGetDirectory(Optional vntWorkingDirectory) As Boolean
bLogout() As Boolean
bAbort() As Boolean
sGetLastError() As String
bLoggedIn() As Boolean


bInit (FTP As CIFTP) As Boolean
Public Functions

You must call this function before you call any other of the classes functions. Generally, you will call blnit during program initialization (in form load or main). The sole argument is the CIFTP control you are wrapping.


BLogin (Optional vntHostName, Optional vntLoginName, Optional
BLogin (Optional vntHostName, Optional vntLoginName, Optional vntPassword, Optional vntWorkingDirectory) As Boolean
Public Functions

Establishes a connection with an FTP server. Either set the HostName, LoginName, and Password properties in the CIFTP control, or pass these as arguments to the function. This wraps the ConnectToAccessControlChannel, USER, PASS, CWD, and PWD methods.

Note that you can pass either the host name or an IP address in the vntHostName argument.


BGetFile (Optional vntLocalFileName, Optional vntRemoteFileName
BGetFile (Optional vntLocalFileName, Optional vntRemoteFileName, Optional vntBinaryFile) As Boolean
Public Functions

Retrieves a file from the FTP server. Either set the CIFTP control's LocalFileName and RemoteFilename properties before calling this function, or pass these as arguments to the function. If vntBinaryFile is True, then the RepresentationType is set to binary (I); otherwise, it is set to ASCII. If it is not supplied, binary is assumed. This wraps the control's TYPE, ConnectToDataChannel, and RETR methods.


bPutFile(Optional vntLocalFileName, Optional vntRemoteFileName
bPutFile(Optional vntLocalFileName, Optional vntRemoteFileName, Optional vntBinaryFile, Optional vntAppend) As Boolean
Public Functions

Copies a local file to an FTP server. Either set the CIFTP control's LocalFileName and RemoteFilename properties before calling this function, or pass these as arguments to the function. If vntBinaryFile is True, then the RepresentationType is set to binary (I); otherwise, it is set to ASCII. If it is not supplied, binary is assumed. If you wish to append to a file on the server, you must pass the optional append argument to the routine (as True). This wraps the TYPE, ConnectToDataChannel, and STOR/APPE methods.


bGetDirectory(Optional vntWorkingDirectory) As Boolean
Public Functions

Populates the files collection and dir/files list boxes. Either set the WorkingDirectory property to the desired location before invoking this function, or pass this as an argument to the function. This wraps the ConnectToDataChannel, CWD, LIST, and PWD methods.


bLogout() As Boolean
Public Functions

Terminates the connection (established by bLogin) to the FTP server.


bAbort() As Boolean
Public Functions

Aborts the currently executing user command. This can be useful if you issue a command and the server is not responding, or you wish to abort an operation such as a large file transfer.


sGetLastError() As String
Public Functions

Provides a readable description of an error occurrence.


bLoggedIn() As Boolean
Public Functions

Determines if you have an active connection with the FTP server.


Public Properties
Related Topics

Get lTotalDataBytesIn() As Long
Get lTotalDataBytesOut() As Long


Get lTotalDataBytesIn() As Long
Public Properties

Provides read-only access to the number of bytes received on the data control channel. This is useful for tracking the status of bGetFile method calls.


Get lTotalDataBytesOut() As Long
Public Properties

Provides read-only access to the number of bytes sent on the data control channel. This is useful for tracking the status of bPutFile method calls.


Public Subs
Related Topics

The following functions mirror functions found in the CIFTP control. You should call them from the equivalent CIFTP event handling code:

ServerResponse(ByVal iCode As Integer, sMsg As String)
EventStateChanged(iState As Integer)
AccessControlPacketReceived(ByRef Packet As String)
DataControlPacketReceived(ByRef Packet As String, ByVal bytes_in
DataControlPacketSent(ByVal bytes_out As Integer)
InternetError(ByVal lErrorNumber As Long, ByRef sErrorMsg As
WSAError(ByVal iErrorNumber As Integer)


ServerResponse(ByVal iCode As Integer, sMsg As String)
Public Subs

You must call this function from the ServerResponse event code for the CIFTP control that is being wrapped.


EventStateChanged(iState As Integer)
Public Subs

You must call this function from the EventStateChanged event code for the CIFTP control that is being wrapped.


AccessControlPacketReceived(ByRef Packet As String)
Public Subs

Call this function from the AccessControlPacketReceived event code for the CIFTP control that is being wrapped, if you wish to have the wrapper class track these packets.


DataControlPacketReceived(ByRef Packet As String, ByVal bytes_in
DataControlPacketReceived(ByRef Packet As String, ByVal bytes_in As Integer)
Public Subs

Call this function from the DataControlPacketReceived event code for the CIFTP control that is being wrapped, if you wish to have the wrapper class track these packets. If you wish to use the timeout facilities provided by the wrapper, you must call this routine since it monitors the time at which packets are received.


DataControlPacketSent(ByVal bytes_out As Integer)
Public Subs

Call this from the DataControlPacketSent event code for the CIFTP control that is being wrapped, if you wish to have the wrapper class track these packets. You must call this routine if you want to use the timeout facilities provided by the wrapper, because the routine monitors the time at which packets are received.


InternetError(ByVal lErrorNumber As Long, ByRef sErrorMsg As
InternetError(ByVal lErrorNumber As Long, ByRef sErrorMsg As String)
Public Subs

Call this function from the InternetError event code for the CIFTP control that is being wrapped. Note that the high level methods are not currently wrapped by this class, so you can safely omit this call.


WSAError(ByVal iErrorNumber As Integer)
Public Subs

You must call this function from the WSAError event code for the CIFTP control that is being wrapped. This enables the wrapper class to handle error conditions correctly.


Public Data Members
Related Topics

iTimeoutValue As Integer
bDumpAccessPackets As Boolean
bDumpDataPackets As Boolean


iTimeoutValue As Integer
Public Data Members

Sets the maximum number of seconds to wait for a server response before timing out. Set the number to 0 for an infinite wait. The default value is 60 seconds.


bDumpAccessPackets As Boolean
Public Data Members

Dumps Access Control Packets to the debug window. This function is useful for debugging purposes. The default value is False.


bDumpDataPackets As Boolean
Public Data Members

Dumps Data Channel Packets to the debug window. This function is useful for debugging purposes. The default value is False.